<#macro commonStyle>

    <!-- favicon -->
	<link rel="icon" href="favicon.ico"/>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>认证管理平台</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/bootstrap/dist/css/bootstrap.min.css">
    <!-- duallistbox -->
    <link rel="stylesheet"
          href="${request.contextPath}/static/adminlte/plugins/bootstrap-duallistbox/dist/bootstrap-duallistbox.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/font-awesome/css/font-awesome.min.css">
    <!-- DataTables -->
    <link rel="stylesheet"
          href="${request.contextPath}/static/adminlte/plugins/datatables.net-bs/css/dataTables.bootstrap.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/Ionicons/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="${request.contextPath}/static/adminlte/dist/css/skins/_all-skins.min.css">
    <!-- Date Picker -->
    <link rel="stylesheet"
          href="${request.contextPath}/static/adminlte/plugins/bootstrap-datepicker/dist/css/bootstrap-datepicker3.min.css">
    <!-- bootstrap wysihtml5 - text editor -->
    <link rel="stylesheet"
          href="${request.contextPath}/static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.min.css">
    <!-- bootstrap-slider -->
    <link rel="stylesheet" href="${request.contextPath}/static/plugins/bootstrap-slider/slider.css">
    <!-- pace -->
    <link rel="stylesheet" href="${request.contextPath}/static/plugins/pace/pace.min.css">

</#macro>

<#macro commonScript>
    <!-- jQuery 3 -->
    <script src="${request.contextPath}/static/adminlte/plugins/jquery/dist/jquery.min.js"></script>

    <!-- Bootstrap 3.3.7 -->
    <script src="${request.contextPath}/static/adminlte/plugins/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- datepicker -->
    <script src="${request.contextPath}/static/adminlte/plugins/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
    <script src="${request.contextPath}/static/adminlte/plugins/bootstrap-datepicker/dist/locales/bootstrap-datepicker.zh-CN.min.js"></script>
    <!-- duallistbox -->
    <script src="${request.contextPath}/static/adminlte/plugins/bootstrap-duallistbox/dist/jquery.bootstrap-duallistbox.min.js"></script>
    <!-- slider -->
    <script src="${request.contextPath}/static/plugins/bootstrap-slider/bootstrap-slider.js"></script>
    <!-- Bootstrap WYSIHTML5 -->
    <script src="${request.contextPath}/static/plugins/bootstrap-wysihtml5/bootstrap3-wysihtml5.all.min.js"></script>
    <!-- DataTables -->
    <script src="${request.contextPath}/static/adminlte/plugins/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="${request.contextPath}/static/adminlte/plugins/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <!-- Slimscroll -->
    <script src="${request.contextPath}/static/adminlte/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script>
    <!-- knob -->
    <script src="${request.contextPath}/static/adminlte/plugins/jquery-knob/jquery.knob.min.js"></script>
    <!-- FastClick -->
    <script src="${request.contextPath}/static/adminlte/plugins/fastclick/fastclick.js"></script>
    <!-- iCheck -->
    <script src="${request.contextPath}/static/plugins/iCheck/icheck.min.js"></script>
    <!-- layer -->
    <script src="${request.contextPath}/static/adminlte/plugins/layer/layer.js"></script>
    <!-- AdminLTE App -->
    <script src="${request.contextPath}/static/adminlte/dist/js/adminlte.min.js"></script>

    <script>
        var base_url = '${request.contextPath}';
        $('#dataList').DataTable();
        $('#duallist').bootstrapDualListbox();
        $.ajaxSetup({
            error: function(xhr,status,error)  {
                if (401 == xhr.status) {
                    window.location.href = xhr.responseJSON.message;
                } else if (403 == xhr.status) {
                    layer.alert(xhr.responseJSON.message, {icon: 5});
                }
            }
        });
    </script>

    <!-- common -->
    <script src="${request.contextPath}/static/js/common.1.js"></script>

</#macro>

<#macro commonHeader>
	<header class="main-header">
        <nav class="navbar navbar-static-top">
            <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
                <span class="sr-only">切换导航</span>
            </a>
            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">
                    <li class="dropdown user user-menu">
                        <a href="${request.contextPath}/logout" id="logoutBtn" class="dropdown-toggle"
                           data-toggle="dropdown" aria-expanded="false">
                            <span class="hidden-xs">注销</span>
                        </a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>
</#macro>

<#macro commonLeft pathName pageName >
	<!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
      <!-- sidebar: style can be found in sidebar.less -->
      <section class="sidebar">
          <!-- Sidebar user panel -->
          <div class="user-panel">
              <div class="pull-left image">
                  <img src="${request.contextPath}/static/adminlte/dist/img/user2-160x160.jpg" class="img-circle"
                       alt="User Image">
              </div>
              <div class="pull-left info">
                  <p><#if Request.sso_user?exists >${Request.sso_user.name!''}</#if></p>
                  <a href="#"><i class="fa fa-circle text-success"></i> Online</a>
              </div>
          </div>
          <ul class="sidebar-menu" data-widget="tree">
              <li class="header">导航</li>
              <li <#if pageName == "index">class="active"</#if> ><a href="${request.contextPath}/"><i
                      class="fa  fa-home"></i><span>首页</span></a></li>
              <li class="treeview <#if pathName == "app">active</#if> ">
                  <a href="#">
                      <i class="fa fa-laptop"></i>
                      <span>应用管理</span>
                      <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                      </span>
                  </a>
                  <ul class="treeview-menu">
                      <li <#if pageName == "appSearch">class="active"</#if> ><a
                              href="${request.contextPath}/app/toSearch"><i class="fa fa-circle-o"></i>应用查询</a></li>
                      <li <#if pageName == "appUser">class="active"</#if> ><a
                              href="${request.contextPath}/app/toAppUser"><i class="fa fa-circle-o"></i>用户授权</a></li>
                      <li <#if pageName == "appRole">class="active"</#if> ><a
                              href="${request.contextPath}/app/toAppRole"><i class="fa fa-circle-o"></i>应用角色维护</a></li>
                      <li <#if pageName == "appPower">class="active"</#if> ><a
                              href="${request.contextPath}/app/toAppPower"><i class="fa fa-circle-o"></i>应用权限维护</a></li>
                  </ul>
              </li>
          <#--<li <#if pageName == "group">class="active"</#if> ><a href="${request.contextPath}/group/toGroup"><i class="fa  fa-group"></i><span>分组管理</span></a></li>-->
              <li <#if pageName == "user">class="active"</#if> ><a href="${request.contextPath}/user/toUser"><i
                      class="fa fa-user"></i><span>用户管理</span></a></li>
              <li class="treeview <#if pathName == "manage">active</#if> ">
                  <a href="#">
                      <i class="fa fa-cubes"></i>
                      <span>系统管理</span>
                      <span class="pull-right-container">
                        <i class="fa fa-angle-left pull-right"></i>
                      </span>
                  </a>
                  <ul class="treeview-menu">
                      <li <#if pageName == "openapi">class="active"</#if> ><a
                              href="${request.contextPath}/manage/toOpenApi"><i
                              class="fa fa-circle-o"></i><span>开放API授权</span></a></li>
                      <li <#if pageName == "person">class="active"</#if> ><a
                              href="${request.contextPath}/manage/toPerson"><i
                              class="fa fa-circle-o"></i><span>人员管理</span></a></li>
                      <li <#if pageName == "department">class="active"</#if> ><a
                              href="${request.contextPath}/manage/toDepartment"><i
                              class="fa fa-circle-o"></i><span>部门管理</span></a></li>
                      <li <#if pageName == "refresh">class="active"</#if> ><a
                              href="${request.contextPath}/manage/toRefresh"><i
                              class="fa fa-circle-o"></i><span>缓存刷新</span></a></li>
                  </ul>
              </li>
          </ul>
      </section>
      <!-- /.sidebar -->
  </aside>
</#macro>
